Posts

Machine learning : GridSearch with Cross Validation , Sklearn

Grid Search Method : 


This function helps you to get the best Kernel, gamma, C hyperparam to have a good prediction with the SVM algorithm.

from sklearn import svm,grid_search
def svc_param_selection(X,y,nfolds=6):
    Cs= [0.001,0.01,1,10]
    gammas=[0.001,0.01,0.1,1,10]
    kernels=['linear','rbf']
    param_grid={'C':cs,'gamma':gammas,'kernel':kernels}
    model = svm.SVC()
    gs= grid_search.GridSearch(model,parm_grid,cv=nfolds)
    gs.fit(X,y)
    gs.best_params_
    return gs.best_params_,gs.best_score_

Error when activating feature of list instance

Image
Hello,

Always we separate our project in features :
feature for the list instance.
feature for the list definition.
that's will help us to keep data of our list when we disable and we enable features.

so we should activate first of all the list definition then the list instance:
when activating the list instance we get this error:


to fix this issue we should add the feature ID in the listInstance elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="TicketLD" OnQuickLaunch="TRUE" TemplateType="100" Url="Lists/Ticket" Description="Ticket List instance" FeatureId="2a3ef305-e7f8-4582-ad89-89612ff82d8b"></ListInstance>
</Elements>


Thanks for sharing.

Developer Dashbord SharePoint PowerShell

Developer Dashbord
$cs = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dash= $cs.DeveloperDashboardSettings
$dash.DisplayLevel
$dash.DisplayLevel="Off" // Ondemand to activate
$dash.Update()


Out-GridView

hello,

in powershell , the is a good tool to check logs or output from powerShell;

Get-SPFeature -Limit ALL | Out-GridView
Hello,

we change our nintex workflow in a list and we should update all lists in the farm we should use this source code :

How to create a folder with Password ? in windows

Image
How to create a folder with Password ?

1.Open your notepad application and write this Bat code:


cls
@ECHO OFF
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Hide your folder Y=yes N=No(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo your password Please
set/p "pass=>"
if NOT %pass%== Password goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Bien Bloquer GG
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End2. replace yo…

Semaphore exemple

this is an exemple in C, to use thread:
//progamme prod_cons.c #include <semaphore.h> #include <unistd.h> //pour sleep #include <pthread.h> #include <stdio.h> #define N 3 sem_t occupe, libre ; int tampon[N]; void* consommateur(void *); void* producteur(void *); int main()  {pthread_t th1,th2; sem_init(&occupe,0,0); // initialiser les sémphores sem_init(&libre,0,N); pthread_create(&th1, NULL,consommateur ,NULL); //cree les threads pthread_create(&th2,NULL,producteur,NULL); pthread_join(th1,NULL); // attendre la fin des threads pthread_join(th2,NULL);       printf("ici main, fin des threads \n"); return 0; } void* producteur(void *depot) {int ip=0, nbprod=0, objet=0; do { sem_wait(&libre); // produire tampon[ip]=objet; sem_post(&occupe); printf("\n ici prod. : tampon[%d]= %d\n", ip,objet); objet++;        nbprod++; ip=(ip+1)%N;         }  while ( nbprod<=30 ); pthread_exit(NULL); } void* consommateur(void *retrait) { int ic=0, nbcon…

Progest System

Image
Try our new application version Béta:

Progest 
it's a Simple application to manage a project ,  create modules, Tasks, affect ressources.. 



url : http://progest.tn Login : user Password: user

there is some functionnlity not available. 
it's will be available in the next version soon 
Thanks for your comments. 

PropretyBag with JavaScript in SharePoint 2013

Image
Hello,
as we know, Property bag are very important in SharePoint development, and to get it with JavaScript is very simple :



//wait until client object model dependencies are loaded before executing our code ExecuteOrDelayUntilScriptLoaded(getWebProperties, "sp.js"); varwebProperties;