我正在用C开发一个链表.我从txt文件中获取数据.但是当我尝试运行程序时,它给了我一个getc()的分段错误.这是代码,
#include<stdio.h>
#include<stdlib.h>
struct node{
char surname[100];
int number[1o0];
char name[100];
struct node *next;
};
typedef struct node Node;
int main()
{
FILE *ifp;
Node first ,*current;
//current =&first;
int i=0,j=0;
int ch;
char num[100],name[100];
ifp = fopen("tele.txt","r");
while (ch != EOF)
{
while(i<4)
{
ch = getc(ifp);
num[i++] = ch;
}
num[i] = '\0';
i=0;
while(ch !='\n')
{
ch = getc(ifp);
if(ch != '\t')
name[j++]=ch;
}
name[j] = '\0';
//ch = '\0';
printf("Number %s\nName %s\n ",num,name);
j=0;
}
fclose(ifp); …Run Code Online (Sandbox Code Playgroud) 我想用Java或PHP(Codeigniter)编写代码,以提取用户上传hbis简历或cv到网站的电子邮件和电话号码等信息.基本上我想构建一个cv解析器.
需要帮助.
谢谢
编辑 cv格式将在doc中.
我是django-cms的新手,经过一番努力,我设法将它安装在我的电脑上.现在我已经在其中创建了一个页面.现在,当我查看该页面时,网址是
http://localhost:8000/first/?preview
Run Code Online (Sandbox Code Playgroud)
我试图用网址访问该页面,
http://localhost:8000/first/
Run Code Online (Sandbox Code Playgroud)
但它没有显示任何东西.我还在覆盖网址中更新了网址,但没有成功.:(有什么东西,我想念?
编辑1 - 这是错误
> Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/first/
URLs.py -
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'myproject.views.home', name='home'),
# url(r'^myproject/', include('myproject.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to …Run Code Online (Sandbox Code Playgroud) 我有一个非常基本的问题要问,为什么我们需要在PATH变量的末尾添加分号,为什么不在JAVA_HOME变量中添加分号?
我读了很多书和论坛:
要在PATH变量中分隔不同的路径?或告诉系统或JRE之后不要再看了。
JAVA_HOME变量用于帮助JRE在将来的开发中查找更多文件和扩展名,例如JDBC驱动程序等。
我有代码将文件上传到服务器.
import org.apache.commons.net.ftp.FTPClient;
import java.io.File;
import java.io.IOException;
import org.apache.commons.net.ftp.FTPFile;
import java.io.FileInputStream;
import java.net.SocketException;
public class FtpConnectDemo {
public static void main(String[] args) throws SocketException, IOException{
FTPClient client = new FTPClient();
FileInputStream fis = null;
client.connect("ftp.someserver.co.uk",21);
boolean login = client.login("webmaster@someserver.co.uk",
"mypassword");
String filename = "E:/workbench j2ee/cPEP_UI/WebContent/engine.xml";
client.storeFile(filename, fis);
client.logout();
fis.close();
}
}
Run Code Online (Sandbox Code Playgroud)
当我运行此代码时,它给了我这个错误:
Exception in thread "main" java.lang.NullPointerException
at FtpConnectDemo.main(FtpConnectDemo.java:22)
Run Code Online (Sandbox Code Playgroud)
用户名,密码,服务器名称都可以.那怎么了?我可以使用telnet连接到FTP.有任何想法吗?
好的,现在我没有得到nullpointer异常,因为我初始化了fis.但我的文件尚未上传; 可能是什么问题?
我需要使用数据库提取邮政编码的第一部分以进行搜索计算.有任何想法吗?!我需要这个在网站上实现一个搜索模块,根据邮政编码查找一些相关信息.但是我用于邮政编码的数据库,它没有邮政编码的第二部分,只有第一部分存在.它用于英国邮政编码.那么,有什么想法吗?!
java ×3
codeigniter ×2
php ×2
c ×1
django ×1
django-cms ×1
ftp ×1
java-home ×1
networking ×1
path ×1
pointers ×1
postal-code ×1
python ×1
url ×1